/* The code is based on the following paper:                                                                                                            */
/*   Chen, T. Y., Lin, Y. L., and Tzeng, L. Y., forthcoming.                                                                                    */
/*   Estimating probability weighting functions through option pricing bounds. Review of Asset Pricing Studies. */
/*                                                                                                                                                                               */
/* Copyright: Tzu-Ying Chen, Yo-Lan Lin, Larry Y. Tzeng                                                                                    */
/* Date: January 30, 2024                                                                                                                                         */

libname CRSP 'E:\WRDS Data\���Y��\CRSP\';

%MACRO HPR (FileName); 
PROC PRINTTO log = "E:\WRDS Data\Record_HPR.log";
RUN;

data sp;
set CRSP.&FileName;
run;

data sp;
set sp;
keep caldt sprtrn;
run;

data sp;
set sp; 
if sprtrn = . then delete;
run;

data _null_;                                         
set sp;                                        
file "E:\WRDS Data\StockReturn_19262021_SP500.txt";
put caldt sprtrn;
run;

%MEND HPR;

%HPR (SP500Index19262021_Daily);
